﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace State
{
    internal class DayState:IState
    {
        private static DayState singleton = new();
        private DayState() { }
        public static DayState Instance { get {  return singleton; } }

        public void DoAlarm(IContext context)
        {
            context.RecordLog("按下警铃（白天）");
        }

        public void DoClock(IContext context, int hour)
        {
            if (hour < 9 || hour >= 17) 
            {
                context.ChangeState(DayState.Instance);
            }
        }

        public void DoPhone(IContext context)
        {
            context.RecordLog("正常通话（白天）");
        }

        public void DoUse(IContext context)
        {
            context.RecordLog("使用金库（白天）");
        }

        public override string ToString()
        {
            return "[ 白天 ]";
        }
    }
}
